{{/* list item of featured image list */}}
{{/* based on li_list.html */}}
{{ $item := . }}

{{/* Dynamic view adjusts to content type. */}}
{{ $icon_pack := "far" }}
{{ $icon := "fa-file-alt" }}
{{ $show_authors := false }}
{{ $show_buttons := false }}
{{ $link := $item.RelPermalink }}
{{ $target := "" }}
{{ if $item.Params.external_link }}
  {{ $link = $item.Params.external_link }}
  {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
{{ if eq $item.Type "post" }}
  {{ $icon = "fa-newspaper" }}
{{ else if eq $item.Type "talk" }}
  {{ $icon = "fa-calendar-alt" }}
{{ else if eq $item.Type "publication" }}
  {{ $show_authors = true }}
  {{ $show_buttons = true }}
{{ else if eq $item.Type "project" }}
  {{ $icon_pack = "fas" }}
  {{ $icon = "fa-project-diagram" }}
  {{ $show_authors = true }}
  {{ $show_buttons = true }}
{{ end }}

<div class="view-list-item">

  <div class="ml-3">
    {{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
    {{ with $resource }}
    {{ $image := .Resize "x50" }}
    <a href="{{$link}}" {{ $target | safeHTMLAttr }}>
      <img src="{{ $image.RelPermalink }}" alt="{{ $item.Title }}">
    </a>
    {{end}}
  </div>

</div>
